<template>
<div class="set-main">
    <div class="main-title">设置页面</div>
    <div class="main-ip">
        <div>本机ip:</div>
        <input type="text" v-model="ipMacDataSetPage.self.netip">
        <div>端口:</div>
        <input type="text" v-model="ipMacDataSetPage.self.macport">
    </div>
    <div class="main-cont">
        <div v-for="(netwall,index) in ipMacDataSetPage.other" :key="index" class="netwall">
            <div class="netwall-title">设置网关</div>
            <div class="netwall-sh">
                <div class="netwall-sh-title">
                    <input class="shebei-index" type="text" v-model="netwall.netid" disabled>
                    <div>网关</div>
                </div>
                <div class="netwall-sh-title2">
                    <div>
                        <div>地址：</div>
                        <input type="text" v-model="netwall.netip">
                    </div>
                    <div>
                        <div>端口：</div>
                        <input type="text" v-model="netwall.macport">
                    </div>
                    <div>
                        <div>wifi地址：</div>
                        <input type="text" v-model="netwall.netmac">
                    </div>
                    <div>
                        <div>蓝牙地址：</div>
                        <input type="text" v-model="netwall.bifimac">
                    </div>
                </div>
            </div>
            <div class="netwall-title">设置网关对应手环</div>
            <div class="netwall-sh" v-for="(shohuan, i) in netwall.netSh" :key="i">
                <div class="netwall-sh-title">
                    <input class="shebei-index" type="text" v-model="shohuan.shid" disabled>
                    <div>手环</div>
                </div>
                <div class="netwall-sh-title">
                    <div>地址：</div>
                    <input type="text" v-model="shohuan.shmac">
                </div>
            </div>
            <div class="netwall-title">设置网关对应气体检测</div>
            <div class="netwall-sh"  v-for="(gas,a) in netwall.netGas" :key="a">
                <div class="netwall-sh-title">
                    <input class="shebei-index" type="text" v-model="gas.gasid" disabled>
                    <div>气体</div>
                </div>
                <div class="netwall-sh-title">
                    <div>地址：</div>
                    <input type="text" v-model="gas.gasmac">
                </div>
            </div>
        </div>
    </div>
    <div class="main-the">
        <div v-for="(item, index) in ipMacDataSetPage.gasthreshold" :key="index">
            <div>{{item.label}}最大值</div>
            <input type="text" style="width: 60px"  v-model="item.valueMax">
            <div>{{item.label}}最小值</div>
            <input type="text" style="width: 60px" v-model="item.valueMin">
        </div>
    </div>
    <div class="main-time">
        <div>
            <div>召回命令间隔</div>
            <input type="text" v-model="ipMacDataSetPage.send.singlesendtimegap">
        </div>
        <div>
            <div>召回单组命令间隔</div>
            <input type="text" v-model="ipMacDataSetPage.send.groupsendtimegap">
        </div>
        <div>
            <div>校时命令间隔</div>
            <input type="text" v-model="ipMacDataSetPage.send.singleClicktimegap">
        </div>
        <div>
            <!-- <div>校时单组命令间隔</div>
            <input type="text" v-model="ipMacDataSetPage.send.groupsClicktimegap"> -->
        </div>
        <!-- <div>
            <div>单次间隔</div>
            <input type="text" v-model="ipMacDataSetPage.send.singletimestart">
        </div>
        <div>
            <div>多次开始</div>
            <input type="text" v-model="ipMacDataSetPage.send.alltimestart">
        </div>
        <div>
            <div>多次间隔</div>
            <input type="text" v-model="ipMacDataSetPage.send.alltimegap">
        </div> -->
        <div>
            <div>网关检验间隔</div>
            <input type="text" v-model="ipMacDataSetPage.send.checkTime">
        </div>
    </div>
    <div class="main-close">
        <div @click="closeFun()">关闭</div>
        <div @click="replayFun()">还原</div>
    </div>
</div>
</template>
<script>
// 此文本为修改参数页面 修改保存为vue storex 插件， 数据存储在 state.ipMacData
export default {
    data() {
        return{
            ipMacDataSetPage: null
        }
    },
    watch:{
        '$store.state.ipMacData'(value) {
            this.ipMacDataSetPage = JSON.parse(JSON.stringify(this.$store.state.ipMacData))
        }
    },
    created(){
        this.ipMacDataSetPage = JSON.parse(JSON.stringify(this.$store.state.ipMacData))
    },
    methods:{
        closeFun(){
            this.$store.commit("changeIpMacData", this.ipMacDataSetPage)
            this.$parent.clseSetBtn()
        },
        replayFun(){
            window.localStorage.clear()
            this.$store.commit("changeFristOpen", false)
            this.$parent.fristFun()
        }
    }
}
</script>
<style lang="css" scoped>

.set-main{
    background: #FFFFFF;
    width: 100%;
    height: 100%;

    padding: 20px;
    box-sizing: border-box;

    display: flex;
    flex-direction: column;
}
.main-ip{
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px auto 20px;
}
.main-title{
    text-align: center;
    font-size: 40px;
}
.main-cont{
    flex: 1;
    display: flex;
    justify-content: space-between;
    background: gray;
}
.netwall{
    width: 23%;
}
.netwall-sh{
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    box-sizing: border-box;
}
.netwall-sh-title{
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 5px;
}
.netwall-sh-title2>div{
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 5px;
}
.netwall-title{
    font-size: 30px;
    padding-bottom: 10px;
    padding-top: 10px;
}
.main-the, .main-the>div{
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.shebei-index{
    width: 20px;
}
.main-close{
    text-align: center;
    margin: 0 auto;

    display: flex;
    justify-content: center;
    gap: 20px;
}
.main-close>div{
    margin-top: 10px;
    box-sizing: border-box;
    height: 40px;
    width: 200px;
    font-size: 30px;
    background: gray;
    border-radius: 20px;
}
.main-close>div:hover{
    background: red;
}
.mac-save{
    background: #4088FF;
    margin-left: 5px;
}

.main-time{
    display: flex;
    justify-content: space-between;
}
.main-time>div{
    display: flex;
}
</style>